import 'package:get/get.dart';
import 'package:getx_tutorial/app/middlewares/auth_middleware.dart';
import 'package:getx_tutorial/app/middlewares/balance_middleware.dart';
import 'package:getx_tutorial/app/modules/home/home_binding.dart';
import 'package:getx_tutorial/app/modules/home/home_page.dart';
import 'package:getx_tutorial/app/modules/home/news_binding.dart';
import 'package:getx_tutorial/app/modules/home/news_page.dart';
import 'package:getx_tutorial/app/modules/index/index_page.dart';
import 'package:getx_tutorial/app/modules/login/login_page.dart';
import 'package:getx_tutorial/app/modules/mine/api/api_page.dart';
import 'package:getx_tutorial/app/modules/mine/getresponsiveview/getresponsiveview_binding.dart';
import 'package:getx_tutorial/app/modules/mine/getresponsiveview/getresponsiveview_page.dart';
import 'package:getx_tutorial/app/modules/mine/getstorage/getstorage_page.dart';
import 'package:getx_tutorial/app/modules/mine/getview/getview_binding.dart';
import 'package:getx_tutorial/app/modules/mine/getview/getview_page.dart';
import 'package:getx_tutorial/app/modules/mine/getwidget/getwidget_binding.dart';
import 'package:getx_tutorial/app/modules/mine/getwidget/getwidget_page.dart';
import 'package:getx_tutorial/app/modules/mine/lang/lang_page.dart';
import 'package:getx_tutorial/app/modules/mine/mine_page.dart';
import 'package:getx_tutorial/app/modules/mine/recharge/recharge_page.dart';
import 'package:getx_tutorial/app/modules/mine/theme/theme_page.dart';
import 'package:getx_tutorial/app/modules/mine/vip/vip_page.dart';
import 'package:getx_tutorial/app/modules/route/route_page.dart';
import 'package:getx_tutorial/app/modules/state/dependency_binding/dependency_binding.dart';
import 'package:getx_tutorial/app/modules/state/dependency_binding/dependency_binding_page.dart';
import 'package:getx_tutorial/app/modules/state/dependency_create/dependency_create_page.dart';
import 'package:getx_tutorial/app/modules/state/dependency_find/dependency_find_page.dart';
import 'package:getx_tutorial/app/modules/state/getbuilder/getbuilder_page.dart';
import 'package:getx_tutorial/app/modules/state/getx/getx_page.dart';
import 'package:getx_tutorial/app/modules/state/getxcontroller/getxcontroller_page.dart';
import 'package:getx_tutorial/app/modules/state/obx/obx_page.dart';
import 'package:getx_tutorial/app/modules/state/obxvalue/obxvalue_page.dart';
import 'package:getx_tutorial/app/modules/state/state_page.dart';
import 'package:getx_tutorial/app/modules/state/valuebuilder/valuebuilder_page.dart';
import 'package:getx_tutorial/app/modules/state/workers/workers_page.dart';
import 'package:getx_tutorial/app/modules/unknown/unknown_page.dart';
part './app_routes.dart';

abstract class AppPages {

  static const INITIAL = Routes.INITIAL;

  static final pages = [
    GetPage(
      name: Routes.INITIAL, 
      page:() => IndexPage(),
    ),
    GetPage(
      name: Routes.LOGIN, 
      page:() => LoginPage(),
    ),
    GetPage(
      name: Routes.HOME, 
      page:() => HomePage(),
      binding: HomeBinding()
    ),
    GetPage(
      name: Routes.NEWS, 
      page:() => NewsPage(),
      binding: NewsBinding()
    ),
    GetPage(
      name: Routes.ROUTE, 
      page:() => RoutePage(),
    ),
    GetPage(
      name: Routes.STATE, 
      page:() => StatePage(),
      children: [
        GetPage(
          name: Routes.OBX,  // /state/obx
          page:() => ObxPage(),
        ),
        GetPage(
          name: Routes.GETXCONTROLLER,  // /state/getxcontroller
          page:() => GetxControllerPage(),
        ),
        GetPage(
          name: Routes.GETX,
          page:() => GetxPage(),
        ),
        GetPage(
          name: Routes.GETBUILDER,
          page:() => GetBuilderPage(),
        ),
        GetPage(
          name: Routes.VALUEBUILDER,
          page:() => ValueBuilderPage(),
        ),
        GetPage(
          name: Routes.OBXVALUE,
          page:() => ObxValuePage(),
        ),
        GetPage(
          name: Routes.WORKERS,
          page:() => WorkersPage(),
        ),
        GetPage(
          name: Routes.DEPENDENCY_FIND,
          page:() => DependencyFindPage(),
        ),
        GetPage(
          name: Routes.DEPENDENCY_CREATE,
          page:() => DependencyCreatePage(),
        ),
        GetPage(
          name: Routes.DEPENDENCY_BINDING,
          page:() => DependencyBindingPage(),
          binding: DependencyBinding()
        ),
      ]
    ),

    GetPage(
      name: Routes.MINE, 
      page:() => MinePage(),
      middlewares: [
        AuthMiddleware(priority: 1)
      ],
      children: [
        GetPage(
          name: Routes.VIP,  // /state/obx
          page:() => VipPage(),
          middlewares: [
            BalanceMiddleware(priority: 2)
          ]
        ),
        GetPage(
          name: Routes.RECHARGE,  // /state/obx
          page:() => RechargePage(),
        ),
        GetPage(
          name: Routes.LANG,  // /state/obx
          page:() => LangPage(),
        ),
        GetPage(
          name: Routes.THEME,  // /state/obx
          page:() => ThemePage(),
        ),
        GetPage(
          name: Routes.GETVIEW,  // /state/obx
          page:() => GetViewPage(),
          binding: GetViewBinding()
        ),
        GetPage(
          name: Routes.GETRESPONSIVEVIEW,  // /state/obx
          page:() => GetResponsiveViewPage(),
          binding: GetResponsiveViewBinding()
        ),
        GetPage(
          name: Routes.GETWIDGET,  // /state/obx
          page:() => GetWidgetPage(),
          binding: GetWidgetBinding()
        ),
        GetPage(
          name: Routes.API,  // /state/obx
          page:() => APIPage()
        ),
        GetPage(
          name: Routes.GETSTORAGE,  // /state/obx
          page:() => GetStoragePage()
        ),
      ]
    ),
  ];

  static final unknownPage = GetPage(
    name: Routes.UNKNOWN, 
    page:() => UnknownPage(),
  );
}